Use the block-mysql driver - #24
Conversation
block/mysql is Block's fork of go-sql-driver/mysql, moving to its own module path (block/mysql#3) because a `replace` directive is not inherited across module boundaries. polt reaches the driver through spirit's dbconn, and spirit is moving with it (block/spirit#1219), so polt follows to keep one driver — and one set of driver types — in the binary. Mechanical: the import path, and `sql.Open("mysql", ...)` -> `"block-mysql"`. Nothing crosses a type boundary here; pkg/test's SetupDB reads fields off *mysql.Config to build a DSN string rather than handing the struct to spirit, so no API had to change. go-sql-driver leaves go.mod entirely, including as an indirect dependency. The block/mysql and block/spirit pins point at unmerged PR branches and must be re-pointed at merged commits before this merges. Verified: build, vet and gofmt clean; all 8 packages pass against MySQL 8.0.44.
There was a problem hiding this comment.
🟡 Changes recommended
The go.mod pins github.com/block/mysql and github.com/block/spirit to pseudo-versions that appear to track unmerged PR branches and should be repointed to merged commits/tags before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR migrates polt from github.com/go-sql-driver/mysql to Block’s fork (github.com/block/mysql) and updates MySQL driver usage to ensure the intended driver is linked across module boundaries (including consistent MySQLError typing).
Changes:
- Replaces imports of
github.com/go-sql-driver/mysqlwithgithub.com/block/mysqlacross tests andpkg/test. - Updates
sql.Open("mysql", ...)calls tosql.Open("block-mysql", ...)across the test suite. - Updates module dependencies to include
github.com/block/mysqland newergithub.com/block/spirit(plus associatedgo.sumchurn).
File summaries
| File | Description |
|---|---|
| pkg/test/test.go | Switches driver import and updates RunSQL to open the block-mysql driver. |
| pkg/stage/stager_test.go | Updates MySQL driver import and sql.Open driver name. |
| pkg/runner/stage_runner_test.go | Updates MySQL driver import and sql.Open driver name. |
| pkg/runner/runner_test.go | Updates sql.Open driver name to block-mysql. |
| pkg/runner/archive_runner_test.go | Updates MySQL driver import and sql.Open driver name. |
| pkg/query/validator_test.go | Updates MySQL driver import and sql.Open driver name. |
| pkg/query/expression_folder_test.go | Updates MySQL driver import and sql.Open driver name (including DSN query params case). |
| pkg/query/explain_test.go | Updates sql.Open driver name to block-mysql. |
| pkg/parquet/write_buffer_test.go | Updates sql.Open driver name to block-mysql. |
| pkg/parquet/arrow_schema_test.go | Updates sql.Open driver name to block-mysql. |
| pkg/boot/stage_booter_test.go | Updates MySQL driver import and sql.Open driver name (incl. replica/open-invalid-DSN cases). |
| pkg/boot/booter_test.go | Updates MySQL driver import for DSN parsing compatibility. |
| pkg/boot/archive_booter_test.go | Updates MySQL driver import and sql.Open driver name. |
| pkg/audit/db_test.go | Updates sql.Open driver name to block-mysql. |
| pkg/archive/table_test.go | Updates MySQL driver import and sql.Open driver name. |
| pkg/archive/file_test.go | Updates MySQL driver import and sql.Open driver name. |
| pkg/archive/buffer_stager_test.go | Updates MySQL driver import and sql.Open driver name. |
| go.mod | Replaces go-sql-driver with block/mysql; updates spirit pin; also bumps testify. |
| go.sum | Updates checksums to reflect dependency migration and version changes. |
Review details
Suppressed comments (1)
go.mod:20
- go.mod pins github.com/block/spirit to a pseudo-version that appears to reference an unmerged PR branch; this should be updated to a merged commit/tag before merging to avoid depending on a mutable branch reference.
github.com/block/spirit v0.17.1-0.20260906193437-6f267e49110f
- Files reviewed: 18/19 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| github.com/aws/aws-sdk-go-v2/config v1.29.1 | ||
| github.com/aws/aws-sdk-go-v2/service/s3 v1.73.2 | ||
| github.com/go-sql-driver/mysql v1.10.0 | ||
| github.com/block/mysql v0.0.0-20260906185715-6346a1ec80d2 |
| github.com/siddontang/loggers v1.0.3 | ||
| github.com/sirupsen/logrus v1.9.3 | ||
| github.com/stretchr/testify v1.12.0 | ||
| github.com/stretchr/testify v1.12.1 | ||
| golang.org/x/sync v0.22.0 |
|
🤖 Adversarial correctness review — Unlike the sibling change in So a site you missed cannot silently bind to upstream; it fails at the What I would change before merge is a pin and a README line.
1 — one of the two pins is discharged and the body no longer says which (low-med)
The body hasn't caught up. Its "Before merge" section still lists both pins, at their pre-
Neither SHA is in I went looking for what breaks if this merges ahead of #1219, and the obvious fear turns out not to be the risk, so it's worth writing down which one is:
Re-pin after #1219 merges, and rewrite the list to name only the outstanding pin. 2 — the Dependencies section still points at the old driver (low)## Dependencies
* Relies on [mysql-client-driver](https://github.com/go-sql-driver/mysql) for connecting to MySQL databases.
* Relies on [Spirit](https://github.com/block/spirit) for chunking the data ...This is the only remaining reference to go-sql-driver anywhere in the repo — one grep hit, no others in Go files, workflows, compose or scripts. It is also the one place a reader is now told something false: after this PR upstream is absent from Same category, not its own row: db, err := sql.Open("block-mysql", test.DSN())
require.NoError(t, err)Every one of those files already imports Verified — the local runs, the mutation, and four attacks that dissolvedLocal: Mutation.
Attack that dissolved: the Attack that dissolved: an exported signature whose type identity changed. Attack that dissolved: polt's production driver isn't actually set by this diff. Only one non-test file changed, and no production path calls Leak check: clean. Nothing internal in the diff. The body names strata and its The probe file was moved out of the tree and the mutation restored from backup; the worktree is clean at This review was generated by Claude Code (claude-opus-5). |
aparajon
left a comment
There was a problem hiding this comment.
🤖 Approving. Two low-severity items in the review above: the spirit pin needs re-pointing once block/spirit#1219 merges, and README.md:58 still names go-sql-driver. Neither is a correctness problem — the substitution is complete and self-verifying (mutation killed, full suite green cold and warm).
This stamp was left by Claude Code (claude-opus-5).
… fork block/spirit#1219 squash-merged as dc3d4c9f, so the pin moves off the PR branch and onto a commit that is an ancestor of spirit main. The Dependencies section still named go-sql-driver, which after this change is not in polt's module graph at all.
github.com/block/mysqlis Block's fork of go-sql-driver/mysql. It is moving toits own module path in block/mysql#3, because a
replacedirective is notinherited across module boundaries — a consumer building against a library that
depends on the fork would silently link upstream instead.
polt reaches the driver through spirit's
dbconn, and spirit is moving with it(block/spirit#1219), so polt follows. Keeping one driver in the binary also keeps
one
*mysql.MySQLErrortype: with both linked,errors.Asacross the boundaryreturns false silently.
The change
Two mechanical substitutions across 12 files:
github.com/go-sql-driver/mysql→github.com/block/mysqlsql.Open("mysql", ...)→sql.Open("block-mysql", ...)There is only one import form in the tree (no aliases), and only one non-test
file:
pkg/test/test.go.No API had to change.
pkg/test'sSetupDB(cfg *mysql.Config, ...)readsUser/Passwd/Addr/DBNameoff the config to build a DSN string rather thanhanding the struct to spirit, so no driver type crosses a module boundary. (strata
does hand a
*mysql.Configtoapplier.Target, which is why strata does notcompile until spirit moves; polt has no such site.) There are no
MySQLErrorassertions anywhere in polt.
go-sql-driver leaves
go.modentirely — not even as an indirect dependency —so polt is single-driver after this.
Pins
Both are on merged code — nothing outstanding:
github.com/block/mysqlv0.0.0-20260906201522-a3178f8dca69mastergithub.com/block/spiritv0.17.1-0.20260906214441-dc3d4c9f4c3bmainVerification
go build ./...,go vet ./...andgofmtclean, with no residual references tothe old import path or driver name. README's Dependencies section now names the fork. Full suite against MySQL 8.0.44 — all 8
packages pass (
archive,audit,boot,parquet,query,runner,stage,upload).